<?php 
header('Content-type: text/html');
header('Content-type: application/rss+xml');
echo '<?xml version="1.0" encoding="utf-8"?>' . "
";
?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
		<title>Epicentr - Whats Coming Up</title>
	    <link><?php echo site_url(); ?></link>
	    <description></description>
	    <dc:language></dc:language>
	    <dc:creator></dc:creator>

	    <dc:rights>Copyright <?php echo gmdate("Y", time()); ?></dc:rights>
	    <admin:generatorAgent rdf:resource="http://www.getepicentr.net" />
	
		<?php if ($comingup):?>

	    <?php foreach($comingup as $key => $activity): ?>
	     <item>
			<title><?=$activity->activity_title;?> <?php if ($activity->dateapplicable == $activity->enddate) echo '[end]'; else if ($activity->dateapplicable == $activity->startdate) echo '[start]';?> on <?=$activity->job_title;?> for <?=$activity->company_name;?></title>
			<link><?=site_url('jobs/showUpdates/'.$activity->jobid);?></link>
			<description><![CDATA[
				<p><strong>Date:</strong> <?php echo date ('d/m/Y', strtotime($activity->dateapplicable));?></p>
				<?=nl2br($activity->activity_notes);?>
				<p>by <?=$activity->firstname;?> <?=$activity->lastname;?></p>
			]]></description>
			<pubDate><?php echo date ('r', strtotime($activity->datecreated));?></pubDate>
	    </item>
	    <?php endforeach; ?>
	    
	    <?php endif;?>
	</channel>
</rss>